<template>
  <organ-save-edit-auto @onSubmit="onSubmit"></organ-save-edit-auto>
</template>

<script>

import {orgPublic, saveOrg} from '@/api/operations-center/org'
import OrganSaveEditAuto from "@/views/operations-center/organ/OrganSaveEditAuto";

export default {
  name: "OrganAdd",
  mixins: [orgPublic],
  components: {
    OrganSaveEditAuto
  },
  data() {
    return {}
  },
  methods: {
    /**
     * {保存}
     *
     * @author: 宋康
     * @date: 2022/8/17 10:16
     */
    onSubmit(formData) {
      saveOrg(formData).then(res => {
        if (res.status) {
          this.$XModal.alert({
            content: '添加成功',
            status: 'success',
          }).then(() => {
            this.cancel();
          })
        } else {
          this.$XModal.alert({
            content: res['msg'],
            status: 'error',
          })
        }
      })
    }
  },
  mounted() {
  }
}
</script>

<style lang="scss" scoped>

</style>
